﻿requirejs.config({
    baseUrl: ".",
    paths: {
    	zepto:"javascripts/zepto.min",
    	dingtalk:"javascripts/dingtalk",
        vue: "components/vue/vue.min",
        axios: "components/axios/axios.min",
        common: "resources/js/common"
    }
});

require(["zepto","dingtalk","vue", "axios", "common"], function (zepto,dingtalk,Vue, axios, common) {
    var vm = new Vue({
        el: "#view",
        data: {
            content: "",
            queryType: "incident",
            result: []
        },
        methods: {
            query: function () {
                var self = this;

                axios.get(this.queryType + "/query?content=" + this.content)
                    .then(function (response) {
                        self.result = response.data;
                    })
            },
            gotoIncidentDetail: function (id, status) {
                if (status == "待分派") {
                    window.location.href = "requesPoolAssignment.html?id=" + id;
                } else {
                    window.location.href = "incidentDetail.html?id=" + id;
                }
            }
        }
    });

});